package framework;

import java.util.ArrayList;
import java.util.List;

public class TranslatorUtils {

	public static List<String> stringToList(String codeString) {
		List<String> returnList = new ArrayList<String>();
		returnList.add(codeString);
		return returnList;
	}
	
	public static int getIndentation(String s){
		char[] string = s.toCharArray();
		int x = 0;
		for(char c : string){
			if(c != ' ' && c != '\t') break;
			if(c == ' '){
				x++;
			} else if (c == '\t'){
				x += 4;
			}
		}
		return x;
	}
	
	public static String getIndentationString(String s){
		return getIndentationString(getIndentation(s));
	}
	
	public static String getIndentationString(int i){
		String returnString = "";
		for(int x = 0; x < i; x++){
			returnString = returnString + " ";
		}
		return returnString;
	}
	
}
